/*
 * L2Comparator.h
 *
 *      Author: Jerome RD Soine and Christoph A Brand
 *      Institution: Schwarz goup, Institute for Theoretical Physics, Heidelberg University, Germany
 */

#ifndef L2COMPARATOR_H_
#define L2COMPARATOR_H_

#include "../utility/AbstractDataContainer.h"
#include "../Comparator.h"


using namespace std;

/*!
 * \brief Implementation of the Least Square Comparator (L2)
 */


class L2Comparator : public Comparator {
protected:
	AbstractDataContainer * data;
	vector<vector<double> > positions;
	vector<vector<double> > displacements;

public:
	L2Comparator(AbstractDataContainer * DATA) ;
	virtual ~L2Comparator() { delete data; };
	virtual L2Comparator * clone() const { return new L2Comparator(data); };

	/*!
	 * Returns the sum of all squared differences of the included experimental displacements and the corresponding simulated displacements.
	 */
	virtual double getComparisonValue(SubstrateModel * substrate_model);

};


#endif /* L2COMPARATOR_H_ */
